const express = require('express')
const app = express();
const data=require('./data.json')
app.get("/goods", (req, res) => {
  res.header("Access-Control-Allow-Origin", "*");
  
  res.json(require ('./data.json'))
})

app.get("/seller", (req, res) => {
  res.header("Access-Control-Allow-Origin", "*");
  
  res.json(
    {
      data:data.seller,
    }
    
  )
})

app.get("/rating",(req,res)=>{
  res.header("Access-Control-Allow-Origin", "*");
  res.json(
    {
      ratingData:data.ratings
    }
  )
})

app.listen('8000', () => {
  console.log("http://localhost:8000");
})